package com.yangcb.workrecord.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import redis.clients.jedis.Jedis;

import java.util.Date;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * ${DESCRIPTION}
 *
 * @author yangcb
 * @create 2017-10-09 15:49
 **/
@Controller
public class RedisLuaController {

    @Autowired
    private MyRedisLua myRedisLua;

    @RequestMapping("init")
    @ResponseBody
    public String initStock() {
        //myRedisLua.seckill();
        myRedisLua.initStock();
        return "SUCCESS";
    }


    @RequestMapping("seckill")
    @ResponseBody
    public Map seckill() {
        //myRedisLua.seckill();
        return myRedisLua.seckill();
    }


}
